package com.teradyne.merlin2.ui.client.activitymappers;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.teradyne.merlin2.ui.client.activities.OrderListActivity;
import com.teradyne.merlin2.ui.client.places.OrderListPlace;

public class CenterActivityMapper implements ActivityMapper {

	private final Provider<OrderListActivity> orderListActivityProvider;

	@Inject
	public CenterActivityMapper(
			Provider<OrderListActivity> orderListActivityProvider) {
		this.orderListActivityProvider = orderListActivityProvider;
	}

	@Override
	public Activity getActivity(Place place) {
		if (place instanceof OrderListPlace) {
			return orderListActivityProvider.get();
		} else {
			return null;
		}
	}
}